import http from "@/utils/request";
import model from "@/config/model";
export default {
  queryWithPage: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/query-with-page`,
    name: "表单Schema配置-分页查询",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  queryWithNoPage: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/query-with-no-page`,
    name: "表单Schema配置-不分页查询",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  queryAll: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/query-all`,
    name: "表单Schema配置-查询所有",
    get: async function () {
      return await http.get(this.url);
    },
  },
  queryById: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/`,
    name: "表单Schema配置-通过id查询",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  queryByTableId: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/query-by-table-id/`,
    name: "表单Schema配置-通过tableId查询",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  save: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/save`,
    name: "表单Schema配置-保存",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  modify: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/modify`,
    name: "表单Schema配置-修改",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  delete: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/delete/`,
    name: "表单Schema配置-删除",
    get: async function (id) {
      return await http.get(this.url + id);
    },
  },
  deleteBatch: {
    url: `${model.API_URL}/code-generator/v1.0/code-generator/delete-batch`,
    name: "表单Schema配置-批量删除",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
};
